﻿using UnityEngine;
using System.Collections;

public class ButtonDestroyObjects : ButtonInterface {

	public bool destroyThis = true;//true si queres solo destruit el objeto cliqueado

	public GameObject[] toDestroy;//si queres q el boton cliqueado destruya objetos

	public override void Click ()
	{
		if (destroyThis)
			Destroy(this.gameObject);

		if (toDestroy.Length>0)
			for(int i = 0;i<toDestroy.Length;i++)
			{
				Destroy(toDestroy[i].gameObject);
			}
	}
}
